/*
 * SongInfoPanel.java
 *
 * Created on September 19, 2005, 3:04 PM
 */
package com.bff.slimserver.musicjukebox.ui.components.favorites;

import com.bff.slimserver.musicjukebox.ui.ThumbnailPanel;
import com.bff.bjj.ui.component.ColorProperties;
import com.bff.bjj.ui.component.BJJPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import org.bff.slimserver.musicobjects.favorite.SlimFavoriteAudioDetails;

/**
 *
 * @author  Bill
 */
public class FavoritesInfoPanel
        extends BJJPanel {

    private ThumbnailPanel thumbnailPanel;
    private boolean showArt;

    public FavoritesInfoPanel() {
        this(null, false);
    }

    public FavoritesInfoPanel(boolean showImageArt) {
        this(null, showImageArt);
    }

    public FavoritesInfoPanel(SlimFavoriteAudioDetails podcast, boolean showImageArt) {
        initComponents();

        this.showArt = showImageArt;

        if (showImageArt) {
            thumbnailPanel = new ThumbnailPanel();
            thumbnailPanel.setPreferredSize(new Dimension(300, 300));
            thumbPanel.add(thumbnailPanel);
        } else {
            remove(thumbPanel);
            remove(songScrollPane);
            add(songScrollPane, BorderLayout.CENTER);
        }

        if (podcast != null) {

            validateFields(podcast);

            setSongInfo(podcast);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPanel2 = new BJJPanel();
        thumbPanel = new BJJPanel();
        thumbPanel.setBackground(ColorProperties.PANEL_COVER_ART_BACKGROUND);
        jPanel3 = new BJJPanel();
        songScrollPane = new javax.swing.JScrollPane();
        jPanel1 = new BJJPanel();
        taDescription = new javax.swing.JTextArea();
        jLabel1 = new javax.swing.JLabel();
        lblArtist = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        lblAlbum = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lblTitle = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lblTrack = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        lblYear = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        lblBitrate = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        lblComment = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        lblType = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        lblDate = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        lblUrl = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        lblDuration = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        lblExplicit = new javax.swing.JLabel();
        taSummary = new javax.swing.JTextArea();
        taSubtitle = new javax.swing.JTextArea();

        setForeground(new java.awt.Color(102, 102, 102));
        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.PAGE_AXIS));

        jPanel2.setMaximumSize(new java.awt.Dimension(310, 310));

        thumbPanel.setMaximumSize(new java.awt.Dimension(300, 300));
        thumbPanel.setMinimumSize(new java.awt.Dimension(300, 300));
        thumbPanel.setPreferredSize(new java.awt.Dimension(300, 300));
        jPanel2.add(thumbPanel);

        add(jPanel2);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Details"));
        jPanel3.setLayout(new java.awt.BorderLayout());

        songScrollPane.setBorder(null);

        jPanel1.setLayout(new java.awt.GridBagLayout());

        taDescription.setColumns(20);
        taDescription.setEditable(false);
        taDescription.setLineWrap(true);
        taDescription.setWrapStyleWord(true);
        taDescription.setOpaque(false);
        taDescription.setPreferredSize(new java.awt.Dimension(290, 94));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanel1.add(taDescription, gridBagConstraints);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel1.setText("Artist:");
        jLabel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel1, gridBagConstraints);

        lblArtist.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblArtist, gridBagConstraints);

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel3.setText("Album:");
        jLabel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel3, gridBagConstraints);

        lblAlbum.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblAlbum, gridBagConstraints);

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel5.setText("Title:");
        jLabel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel5, gridBagConstraints);

        lblTitle.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblTitle, gridBagConstraints);

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel7.setText("Track:");
        jLabel7.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel7, gridBagConstraints);

        lblTrack.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblTrack, gridBagConstraints);

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel9.setText("Year:");
        jLabel9.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel9, gridBagConstraints);

        lblYear.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblYear, gridBagConstraints);

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel11.setText("Bitrate:");
        jLabel11.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel11, gridBagConstraints);

        lblBitrate.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblBitrate, gridBagConstraints);

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel12.setText("Comment:");
        jLabel12.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel12, gridBagConstraints);

        lblComment.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblComment, gridBagConstraints);

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel13.setText("Type:");
        jLabel13.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel13, gridBagConstraints);

        lblType.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblType, gridBagConstraints);

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel14.setText("Date:");
        jLabel14.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel14, gridBagConstraints);

        lblDate.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblDate, gridBagConstraints);

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel15.setText("Url:");
        jLabel15.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel15, gridBagConstraints);

        lblUrl.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblUrl, gridBagConstraints);

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel16.setText("Description:");
        jLabel16.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.insets = new java.awt.Insets(3, 5, 0, 0);
        jPanel1.add(jLabel16, gridBagConstraints);

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel17.setText("Summary:");
        jLabel17.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.insets = new java.awt.Insets(3, 5, 0, 0);
        jPanel1.add(jLabel17, gridBagConstraints);

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel18.setText("Subtitle:");
        jLabel18.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.insets = new java.awt.Insets(3, 5, 0, 0);
        jPanel1.add(jLabel18, gridBagConstraints);

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel19.setText("Duration:");
        jLabel19.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel19, gridBagConstraints);

        lblDuration.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 13;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblDuration, gridBagConstraints);

        jLabel20.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        jLabel20.setText("Explicit:");
        jLabel20.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel20, gridBagConstraints);

        lblExplicit.setForeground(new java.awt.Color(0, 102, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 14;
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
        jPanel1.add(lblExplicit, gridBagConstraints);

        taSummary.setEditable(false);
        taSummary.setLineWrap(true);
        taSummary.setRows(5);
        taSummary.setWrapStyleWord(true);
        taSummary.setMinimumSize(new java.awt.Dimension(280, 22));
        taSummary.setOpaque(false);
        taSummary.setPreferredSize(new java.awt.Dimension(290, 94));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanel1.add(taSummary, gridBagConstraints);

        taSubtitle.setEditable(false);
        taSubtitle.setLineWrap(true);
        taSubtitle.setRows(5);
        taSubtitle.setWrapStyleWord(true);
        taSubtitle.setMinimumSize(new java.awt.Dimension(280, 22));
        taSubtitle.setOpaque(false);
        taSubtitle.setPreferredSize(new java.awt.Dimension(290, 94));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanel1.add(taSubtitle, gridBagConstraints);

        songScrollPane.setViewportView(jPanel1);

        jPanel3.add(songScrollPane, java.awt.BorderLayout.CENTER);

        add(jPanel3);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JLabel lblAlbum;
    private javax.swing.JLabel lblArtist;
    private javax.swing.JLabel lblBitrate;
    private javax.swing.JLabel lblComment;
    private javax.swing.JLabel lblDate;
    private javax.swing.JLabel lblDuration;
    private javax.swing.JLabel lblExplicit;
    private javax.swing.JLabel lblTitle;
    private javax.swing.JLabel lblTrack;
    private javax.swing.JLabel lblType;
    private javax.swing.JLabel lblUrl;
    private javax.swing.JLabel lblYear;
    private javax.swing.JScrollPane songScrollPane;
    private javax.swing.JTextArea taDescription;
    private javax.swing.JTextArea taSubtitle;
    private javax.swing.JTextArea taSummary;
    private javax.swing.JPanel thumbPanel;
    // End of variables declaration//GEN-END:variables

    /**
     * Pass null to remove all info
     * @param song
     */
    public void setSongInfo(SlimFavoriteAudioDetails song) {
        if (song != null) {
            validateFields(song);

            try {
                if (song != null) {

                    validateFields(song);

                    if (showArt) {
                        thumbnailPanel.loadImage(song);
                    }
                } else {
                    lblAlbum.setText("");
                    lblArtist.setText("");
                    lblTitle.setText("");
                    lblTrack.setText("");

                    jLabel12.setVisible(true);
                    lblComment.setVisible(true);
                    lblComment.setText("");

                    setBitrate("");

                    jLabel9.setVisible(true);
                    lblYear.setVisible(true);
                    lblYear.setText("");
                    if (showArt) {
                        thumbnailPanel.removeImage();
                    }
                }

            } catch (NullPointerException npe) {
                //dont give a shit
                npe.printStackTrace();
            }
        }
    }

    public void setBitrate(String bitrate) {
        lblBitrate.setText(bitrate);
        /*
        if (bitrate < 0) {
        jLabel11.setVisible(false);
        lblBitrate.setVisible(false);
        } else {
        jLabel11.setVisible(true);
        lblBitrate.setVisible(true);
        }

        if (bitrate > 0) {
        jLabel11.setVisible(true);
        lblBitrate.setVisible(true);
        if (bitrate > 1000) {
        lblBitrate.setText(Integer.toString(bitrate / 1000) + " kpbs");
        } else {
        lblBitrate.setText(Integer.toString(bitrate) + " kbps");
        }
        }
         */

    }

    private void validateFields(SlimFavoriteAudioDetails podcast) {

        lblTitle.setText(podcast.getTitle());

        if (podcast.getComment() == null || "".equals(podcast.getComment())) {
            jLabel12.setVisible(false);
            lblComment.setVisible(false);
            lblComment.setText(podcast.getComment());
        } else {
            jLabel12.setVisible(true);
            lblComment.setVisible(true);
        }

        if (podcast.getBitrate() == null || "".equals(podcast.getBitrate())) {
            jLabel11.setVisible(false);
            lblBitrate.setVisible(false);
        } else {
            jLabel11.setVisible(true);
            lblBitrate.setVisible(true);
            setBitrate(podcast.getBitrate());
        }




        if (podcast.getArtist() == null || "".equals(podcast.getArtist())) {
            jLabel1.setVisible(false);
            lblArtist.setVisible(false);
        } else {
            jLabel1.setVisible(true);
            lblArtist.setVisible(true);
            lblArtist.setText(podcast.getArtist());
        }

        if (podcast.getAlbum() == null ||
                "".equals(podcast.getAlbum().getName()) ||
                podcast.getAlbum().getName() == null) {
            jLabel3.setVisible(false);
            lblAlbum.setVisible(false);
        } else {
            jLabel3.setVisible(true);
            lblAlbum.setVisible(true);
            lblAlbum.setText(podcast.getAlbum().getName());
        }

        if (podcast.getTrack() < 1) {
            jLabel7.setVisible(false);
            lblTrack.setVisible(false);
        } else {
            jLabel7.setVisible(true);
            lblTrack.setVisible(true);
            lblTrack.setText(Integer.toString(podcast.getTrack()));
        }

        if (podcast.getYear() == null || "".equals(podcast.getYear()) || "0".equals(podcast.getYear())) {
            jLabel9.setVisible(false);
            lblYear.setVisible(false);
        } else {
            jLabel9.setVisible(true);
            lblYear.setVisible(true);
            lblYear.setText(podcast.getYear());
        }

        if (podcast.isRemote() && podcast.getType() != null && !"".equalsIgnoreCase(podcast.getType())) {
            jLabel13.setVisible(true);
            lblType.setVisible(true);
            lblType.setText(podcast.getType());
        } else {
            jLabel13.setVisible(false);
            lblType.setVisible(false);
        }

        if (podcast.getPubDate() != null && !"".equalsIgnoreCase(podcast.getPubDate())) {
            jLabel14.setVisible(true);
            lblDate.setVisible(true);
            lblDate.setText(podcast.getPubDate());
        } else {
            jLabel14.setVisible(false);
            lblDate.setVisible(false);
        }

        if (podcast.getUrl() != null && !"".equalsIgnoreCase(podcast.getUrl())) {
            jLabel15.setVisible(true);
            lblUrl.setVisible(true);
            lblUrl.setText(podcast.getUrl());
        } else {
            jLabel15.setVisible(false);
            lblUrl.setVisible(false);
        }

        if (podcast.getDescription() != null && !"".equalsIgnoreCase(podcast.getDescription())) {
            jLabel16.setVisible(true);
            taDescription.setVisible(true);
            taDescription.setText(podcast.getDescription());
        } else {
            jLabel16.setVisible(false);
            taDescription.setVisible(false);
        }

        if (podcast.getSummary() != null && !"".equalsIgnoreCase(podcast.getSummary())) {
            jLabel17.setVisible(true);
            taSummary.setVisible(true);
            taSummary.setText(podcast.getSummary());
        } else {
            jLabel17.setVisible(false);
            taSummary.setVisible(false);
        }

        if (podcast.getSubTitle() != null &&
                !"".equalsIgnoreCase(podcast.getSubTitle()) &&
                !podcast.getSubTitle().equalsIgnoreCase(podcast.getSummary()) &&
                !podcast.getSubTitle().equalsIgnoreCase(podcast.getDescription())) {
            jLabel18.setVisible(true);
            taSubtitle.setVisible(true);
            taSubtitle.setText(podcast.getSummary());
        } else {
            jLabel18.setVisible(false);
            taSubtitle.setVisible(false);
        }

        //if (podcast.getLength() != null && !"".equalsIgnoreCase(podcast.getDuration())) {
        //    jLabel19.setVisible(true);
        //    lblDuration.setVisible(true);
        //    lblDuration.setText(podcast.getDuration());
        //} else {
            jLabel19.setVisible(false);
            lblDuration.setVisible(false);
        //}

        if (podcast.getExplicit() != null && !"".equalsIgnoreCase(podcast.getExplicit())) {
            jLabel20.setVisible(true);
            lblExplicit.setVisible(true);
            lblExplicit.setText(podcast.getExplicit());
        } else {
            jLabel20.setVisible(false);
            lblExplicit.setVisible(false);
        }
    }
}
